package com;

import com.bean.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class Main {
    public static void main(String[] args) {
        Car car = new Car("1001","奔驰",1000000);
        System.out.println(car.getId());
        System.out.println(car.getName());
        System.out.println(car.getPrice());

        // 从spring容器中获取对象
        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
        Car car2 = (Car) ac.getBean("p1");
        System.out.println(car2);
    }
}